package cn.yl.caner.service;

import java.sql.SQLException;

import cn.yl.caner.dao.CheckDao;

public class CheckService {
	
		//检查ajax判断是否存在
		public boolean check(String is,String index) {
			CheckDao check = new CheckDao();
			boolean isExist =false;
			try {
				Long result = check.check(is,index);
				isExist = (result>0 ?true:false);
			} catch (SQLException e) {
				e.printStackTrace();
			}
			return isExist;
		}
		//检查密码判断是否正确
		public boolean checkPassword(String password,String username) {
			CheckDao check = new CheckDao();
			boolean isExist =false;
			try {
				Long result = check.checkPassword(password,username);
				isExist = (result>0 ?true:false);
			} catch (SQLException e) {
				e.printStackTrace();
			}
			return isExist;
		}
	
}
